<% rowbg = 0 %>
<% form_for(source.becomes(Source)) do |f| %>
	<%= flash_and_form_errors(source) %>
	<table class="form">
		<tr class="rowbg<%= rowbg = 1 - rowbg %>">
			<td class="name">Name*</td>
			<td class="value"><%= f.text_field(:name) %></td>
			<td class="details">A simple name for this source, e.g. "New York Times" or "Twitter 1". Please use only letters, numbers, and spaces.</td>
		</tr>
		<tr class="rowbg<%= rowbg = 1 - rowbg %>">
			<td class="name">Kind*</td>
			<td class="value">
				<% if source.new_record? %>
					<%= f.select(:kind, Source.types, :include_blank => true) %></td>
				<% else %>
					<%= source.kind %>
				<% end %>
			</td>
			<td class="details"></td>
		</tr>
		<tr class="rowbg<%= rowbg = 1 - rowbg %>">
			<td class="name">URL</td>
			<td class="value"><%= f.text_field(:url, :id => "url_field") %></td>
			<td class="details">The URL that Aggie should pull from. Not required for Twitter or Email.</td>
		</tr>
		<tr class="rowbg<%= rowbg = 1 - rowbg %>">
			<td class="name">Keywords</td>
			<td class="value"><%= f.text_area(:keywords, :id => "keywords_field") %></td>
			<td class="details">Comma separated list of keywords that Aggie should use to filter content from this source. Required for Twitter. Optional for others.</td>
		</tr>
		<tr class="rowbg<%= rowbg = 1 - rowbg %>">
			<td class="name">Languages</td>
			<td class="value"><%= f.text_field(:languages, :id => "languages_field") %></td>
			<td class="details">Comma separated list of <%= link_to('2-letter language codes', 'http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes') %>
				that Aggie should accept. Leave blank to accept any languages. 
				Any content without a specified language will be accepted regardless.
			</td>
		</tr>
		<tr class="rowbg<%= rowbg = 1 - rowbg %>">
			<td class="name">Is Enabled?</td>
			<td class="value"><%= f.check_box(:enabled) %></td>
			<td class="details">Whether Aggie should gather content from this source.</td>
		</tr>
	</table>
	<%= f.submit((source.new_record? ? "Create" : "Update") + " Source") %>
<% end %>